﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class MasterPage_MasterPage : System.Web.UI.MasterPage
{
    protected List<string> jsList = null;
    protected void Page_Load(object sender, EventArgs e)
    {
        Dictionary<string, string> jsList = new Dictionary<string, string>();
        string[] ulCSS = {"CIB","WMG","CFG" };
        foreach (string css in ulCSS)
        {
            jsList.Add(css, " $(function(){$('." + css + "').hide();});");
        }

        List<string> result = Session["result"] as List<string>;
        //從2開始
        
        for (int i = 2; i < result.Count; i++)
        {
            if(jsList.ContainsKey(result[i].ToString()))
            {
                jsList.Remove(result[i].ToString());
            }
        }

        
        Utility.LoadJquery(this, "jquery", "jquery");
        Utility.LoadJquery(this, "jqueryUI", "jqueryUI");
        int x = 0;
        Dictionary<string, string>.ValueCollection values = jsList.Values;
        foreach (string s in values)
        {
            ScriptManager.RegisterClientScriptBlock(this
                , this.GetType(), string.Format("ulblock{0}",x) , s, true);
            x++;
        }
    }
}
